﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Autoverwaltung.Model
{
    public class Hersteller : IAutoverwaltungModel, IEquatable<Hersteller>
    {
        /// <summary>
        /// Der Name des Herstellers.
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// <see cref="Autoverwaltung.Model.IAutoverwaltungsModel"/>
        /// </summary>
        public int Id { get; set; }

        public bool Equals(Hersteller other)
        {
            if (other == null)
            {
                return false;
            }

            bool nameCheck = (this.Name != null && this.Name.Equals(other.Name) || this.Name == null && other.Name == null);

            return this.Id.Equals(other.Id) && nameCheck;
        }
    }
}
